package com.hdcircles.autoform.model.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

import javax.inject.Inject;

/**
 * Created by simon on 16/9/28.
 */

public class QuestionBean  implements Parcelable {

    private Integer Id;

    private String QuestionId;

    private int Type =Integer.MAX_VALUE;

    private String QuestionTitle;

    private String TextAnswer;

    private List<ChooseQuestionBean> ChooseQuestion;

    private String Date;

    private String Location;

    private boolean IsRequired;

    private boolean IsCompleted;

    private Integer Form_Id;

    private String Picture;

    private List<String> PictureList;


    @Inject
    public QuestionBean() {
    }

    public Integer getForm_Id() {
        return Form_Id;
    }

    public void setForm_Id(Integer form_Id) {
        Form_Id = form_Id;
    }

    public int getId() {
        return Id;
    }

    public void setId(Integer id) {
        Id = id;
    }

    public String getQuestionId() {
        return QuestionId;
    }

    public void setQuestionId(String questionId) {
        QuestionId = questionId;
    }

    public String getPicture() {
        return Picture;
    }

    public void setPicture(String picture) {
        Picture = picture;
    }

    public int getType() {
        return Type;
    }

    public void setType(int type) {
        this.Type = type;
    }


    public String getQuestionTitle() {
        return QuestionTitle;
    }

    public void setQuestionTitle(String questionTitle) {
        this.QuestionTitle = questionTitle;
    }

    public String getTextAnswer() {
        return TextAnswer;
    }

    public void setTextAnswer(String textAnswer) {
        this.TextAnswer = textAnswer;
    }

    public List<ChooseQuestionBean> getChooseQuestion() {
        return ChooseQuestion;
    }

    public void setChooseQuestion(List<ChooseQuestionBean> chooseQuestion) {
        this.ChooseQuestion = chooseQuestion;
    }

    public String getDate() {
        return Date;
    }

    public void setDate(String date) {
        this.Date = date;
    }

    public String getLocation() {
        return Location;
    }

    public void setLocation(String location) {
        this.Location = location;
    }

    public boolean isRequired() {
        return IsRequired;
    }

    public void setRequired(boolean required) {
        IsRequired = required;
    }

    public boolean isCompleted() {
        return IsCompleted;
    }

    public void setCompleted(boolean completed) {
        IsCompleted = completed;
    }

    public List<String> getPictureList() {
        return PictureList;
    }

    public void setPictureList(List<String> pictureList) {
        PictureList = pictureList;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.Id);
        dest.writeString(this.QuestionId);
        dest.writeInt(this.Type);
        dest.writeString(this.QuestionTitle);
        dest.writeString(this.TextAnswer);
        dest.writeTypedList(this.ChooseQuestion);
        dest.writeString(this.Date);
        dest.writeString(this.Location);
        dest.writeByte(this.IsRequired ? (byte) 1 : (byte) 0);
        dest.writeByte(this.IsCompleted ? (byte) 1 : (byte) 0);
        dest.writeValue(this.Form_Id);
        dest.writeString(this.Picture);
        dest.writeStringList(this.PictureList);
    }

    protected QuestionBean(Parcel in) {
        this.Id = (Integer) in.readValue(Integer.class.getClassLoader());
        this.QuestionId = in.readString();
        this.Type = in.readInt();
        this.QuestionTitle = in.readString();
        this.TextAnswer = in.readString();
        this.ChooseQuestion = in.createTypedArrayList(ChooseQuestionBean.CREATOR);
        this.Date = in.readString();
        this.Location = in.readString();
        this.IsRequired = in.readByte() != 0;
        this.IsCompleted = in.readByte() != 0;
        this.Form_Id = (Integer) in.readValue(Integer.class.getClassLoader());
        this.Picture = in.readString();
        this.PictureList = in.createStringArrayList();
    }

    public static final Creator<QuestionBean> CREATOR = new Creator<QuestionBean>() {
        @Override
        public QuestionBean createFromParcel(Parcel source) {
            return new QuestionBean(source);
        }

        @Override
        public QuestionBean[] newArray(int size) {
            return new QuestionBean[size];
        }
    };
}
